class Supply {
  String code;
  String msg;
  List<SupplyModel> data;

  Supply({this.code, this.msg, this.data});

  Supply.fromJson(Map<String, dynamic> json) {
    code = json['code'];
    msg = json['msg'];
    if (json['data'] != null) {
      data = new List<SupplyModel>();
      json['data'].forEach((v) {
        data.add(new SupplyModel.fromJson(v));
      });
    }
  }
  static T generObj<T>(json) {
    return Supply.fromJson(json) as T;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['code'] = this.code;
    data['msg'] = this.msg;
    if (this.data != null) {
      data['data'] = this.data.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class SupplyModel {
  String title;
  String amount;
  String edittime;
  String catid;
  String itemid;
  String linkurl;
  String leixing;
  String unit;
  String price;
  String chandi;
  String truename;
  String cangku;
  String username;
  String thumb;
  String ifprice;
  String leixing2;
  PubUser pubUser;

  SupplyModel(
      {this.title,
      this.amount,
      this.edittime,
      this.catid,
      this.itemid,
      this.linkurl,
      this.leixing,
      this.unit,
      this.price,
      this.chandi,
      this.truename,
      this.cangku,
      this.username,
      this.thumb,
      this.ifprice,
      this.leixing2,
      this.pubUser});
  static T generOBJ<T>(json) {
    return SupplyModel.fromJson(json) as T;
  }

  SupplyModel.fromJson(Map<String, dynamic> json) {
    title = json['title'];
    amount = json['amount'];
    edittime = json['edittime'];
    catid = json['catid'];
    itemid = json['itemid'];
    linkurl = json['linkurl'];
    leixing = json['leixing'];
    unit = json['unit'];
    price = json['price'].toString();
    chandi = json['chandi'];
    truename = json['truename'];
    cangku = json['cangku'];
    username = json['username'];
    thumb = json['thumb'];
    ifprice = json['ifprice'];
    leixing2 = json['leixing2'];
    pubUser =
        json['pubUser'] != null ? new PubUser.fromJson(json['pubUser']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['title'] = this.title;
    data['amount'] = this.amount;
    data['edittime'] = this.edittime;
    data['catid'] = this.catid;
    data['itemid'] = this.itemid;
    data['linkurl'] = this.linkurl;
    data['leixing'] = this.leixing;
    data['unit'] = this.unit;
    data['price'] = this.price;
    data['chandi'] = this.chandi;
    data['truename'] = this.truename;
    data['cangku'] = this.cangku;
    data['username'] = this.username;
    data['thumb'] = this.thumb;
    data['ifprice'] = this.ifprice;
    data['leixing2'] = this.leixing2;
    if (this.pubUser != null) {
      data['pubUser'] = this.pubUser.toJson();
    }
    return data;
  }
}

class PubUser {
  String userid;
  String mobile;
  String username;
  String intactcom;
  String intact;
  String avatar;
  String truename;
  String telcount;
  String vtruename;
  String vcompany;
  String longlat;
  String homepic;
  String areaid;
  String deposit;
  String litsmall;
  String company;
  String address;
  String business;
  String mode;
  String hits;
  String pubsell;
  // String pubbuy;
  int pubmechan;
  // double longitude;
  // double latitude;
  String regtime;
  String avaImg;
  String homeQR;
  String token;
  String areaname;

  PubUser(
      {this.userid,
      this.mobile,
      this.username,
      this.intactcom,
      this.intact,
      this.avatar,
      this.truename,
      this.telcount,
      this.vtruename,
      this.vcompany,
      this.longlat,
      this.homepic,
      this.areaid,
      this.deposit,
      this.litsmall,
      this.company,
      this.address,
      this.business,
      this.mode,
      this.hits,
      this.pubsell,
      // this.pubbuy,
      this.pubmechan,
      // this.longitude,
      // this.latitude,
      this.regtime,
      this.avaImg,
      this.homeQR,
      this.token,
      this.areaname});

  PubUser.fromJson(Map<String, dynamic> json) {
    userid = json['userid'];
    mobile = json['mobile'];
    username = json['username'];
    intactcom = json['intactcom'];
    intact = json['intact'];
    avatar = json['avatar'];
    truename = json['truename'];
    telcount = json['telcount'];
    vtruename = json['vtruename'];
    vcompany = json['vcompany'];
    longlat = json['longlat'];
    homepic = json['homepic'];
    areaid = json['areaid'];
    deposit = json['deposit'];
    litsmall = json['litsmall'];
    company = json['company'];
    address = json['address'];
    business = json['business'];
    mode = json['mode'];
    hits = json['hits'];
    pubsell = json['pubsell'];
    // pubbuy = json['pubbuy'];
    pubmechan = json['pubmechan'];
    // longitude = json['longitude'];
    // latitude = json['latitude'];
    regtime = json['regtime'];
    avaImg = json['ava_img'];
    homeQR = json['homeQR'];
    token = json['token'];
    areaname = json['areaname'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['userid'] = this.userid;
    data['mobile'] = this.mobile;
    data['username'] = this.username;
    data['intactcom'] = this.intactcom;
    data['intact'] = this.intact;
    data['avatar'] = this.avatar;
    data['truename'] = this.truename;
    data['telcount'] = this.telcount;
    data['vtruename'] = this.vtruename;
    data['vcompany'] = this.vcompany;
    data['longlat'] = this.longlat;
    data['homepic'] = this.homepic;
    data['areaid'] = this.areaid;
    data['deposit'] = this.deposit;
    data['litsmall'] = this.litsmall;
    data['company'] = this.company;
    data['address'] = this.address;
    data['business'] = this.business;
    data['mode'] = this.mode;
    data['hits'] = this.hits;
    data['pubsell'] = this.pubsell;
    // data['pubbuy'] = this.pubbuy;
    data['pubmechan'] = this.pubmechan;
    // data['longitude'] = this.longitude;
    // data['latitude'] = this.latitude;
    data['regtime'] = this.regtime;
    data['ava_img'] = this.avaImg;
    data['homeQR'] = this.homeQR;
    data['token'] = this.token;
    data['areaname'] = this.areaname;
    return data;
  }
}
